const { DataTypes } = require("sequelize");
const seq = require("../db/seq");

//创建模型类
const Question = seq.define("Question", {
  questionTitle: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false,
    comment: "题目",
  },
  questionAnswer: {
    type: DataTypes.TEXT,
    allowNull: false,
    unique: false,
    comment: "答案",
  },
  questionType: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false,
    comment: "题目类别",
  },
  userId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    unique: false,
    comment: "管理员Id",
  },
  questionPreView: {
    type: DataTypes.TEXT,
    allowNull: false,
    unique: false,
    comment: "题目预览",
  },
  lookNum: {
    type: DataTypes.BIGINT,
    allowNull: false,
    unique: false,
    comment: "浏览量",
  },
});

// Question.sync({ force: true })

module.exports = Question;
